#include <iostream>
#include <string>
#include "strHandler.hpp"
using namespace std;
using namespace str;

int main()
{
    string str1("handsomeboy");

    str1.replace(0, 4, "");
    cout << str1 << endl;

    string str2 = "Hello World";

    // str::swapcase
    str2 = str::swapcase(str2);
    cout << str2 << endl;

    // str::upper
    str2 = str::upper(str2);
    cout << str2 << endl;

    // str::lower
    str2 = str::lower(str2);
    cout << str2 << endl;

    // str::del
    string str3 = "123jlk213jlk123lkj1232jlk123jlkj123";
    str::del(str3, "123");
    cout << str3 << endl;

    // str::replace
    string str4 = "123jlk213jlk123lkj1232jlk123jlkj123";
    replace(str4, "123", "*");
    cout << str4 << endl;

    // str::rstrip
    string str5 = "handsomeboyboyboyboy1";
    rstrip(str5, "boy");
    cout << str5 << endl;
    string str6 = "handsomeboyboyboyboy";
    rstrip(str6, "boy");
    cout << str6 << endl;

    // str:: lstrip
    string str7 = "helhelhello world!";
    lstrip(str7, "hel");
    cout << str7 << endl;
    string str8 = "heelhelhello world!";
    lstrip(str8, "hel");
    cout << str8 << endl;

    string str9 = "hand,some,boy,";
    vector<string> res = str::split(str9, ",");
    for (int i = 0; i < res.size(); ++i)
    {
        cout << res[i] << endl;
    }
    cout << "res size = " << res.size() << endl;

    string str10 = "xsz,hand,xsz,some,xsz,boy,xsz";
    cout << "cnt = " << count(str10, "xsz") << endl;

    string str11 = "xsz,hand,xsz,some,xsz,boy,xsz";
    strip(str11, "xsz");
    cout << str11 << endl;

    return 0;
}